home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gnulib / libsrc98.zoo / fputs.c < prev    next >
C/C++ Source or Header  |  1994-03-29  |  322b  |  23 lines

  1. /* from Dale Schumacher's dLibs */
  2.  
  3. #include <stdio.h>
  4. #include <stddef.h>
  5. #include <assert.h>
  6.  
  7. int
  8. fputs(data, fp)
  9.   register const char *data;
  10.   register FILE *fp;
  11. {
  12.   register int n = 0;
  13.     
  14.   assert((data != NULL));
  15.   while (*data)
  16.   {
  17.     if (fputc(*data++, fp) == EOF)
  18.       return (EOF);
  19.     ++n;
  20.   }
  21.   return (n);
  22. }
  23.